<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>sticky</title>
</head>
<style>
    *{
        padding: 0;
        margin: 0;
    }
    .header{
        height: 200px;
        background-color: slateblue;
    }
    .nav{
        height: 50px;
        background-color: slategray;
        position: sticky;
        top: 0;
        }
        .new{
            height: 500px;
            background-color: tan;
            padding: 50px 0;
        }
        .center{
            margin: 0 auto;
            width: 1000px;
        }
</style>
<body>
    <div class="header">
        <div class="center">saedfuyh</div>
    </div>
    <div class="nav">
        <div class="center">jodansc</div>
    </div>
    <div class="new">
        <div class="center">jdcjkdsc</div>
    </div>
    <div style="height: 2000px;"></div>
</body>
</html>